<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 <script   language="JavaScript"   type=text/Jscript   src="1.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/WEB-INF/pages/admin/public/meta.jsp"></jsp:include>

<title>添加用户 </title>
</head>
<body>
<article class="page-container">
	<form action="insertMember.action" method="post" class="form form-horizontal" id="form-member-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>用户名：</label>
			<div class="formControls col-xs-8 col-sm-5">
				<input type="text" class="input-text" value="" placeholder="" id="username" name="name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>密码：</label>
			<div class="formControls col-xs-8 col-sm-5">
				<input type="password" class="input-text" value="" placeholder="" id="password" name="password">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>电话：</label>
			<div class="formControls col-xs-8 col-sm-5">
				<input type="text" class="input-text" value="" placeholder="" id="mobile" name="cellphone">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>邮箱：</label>
			<div class="formControls col-xs-8 col-sm-5">
				<input type="text" class="input-text" placeholder="@" name="email" id="email">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">所在城市：</label>
			<div class="formControls col-xs-8 col-sm-5"> <span class="select-box">
				<select class="select" size="1" name="loginId">
					<option value="${loginId}" selected>请选择省份</option>
					<c:forEach var="province" items="${provincelist}">
						<option value="${province.name }">${province.name }</option>
					</c:forEach>
				</select>
				</span> 
				</div>
		</div>
		
		
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" onclick="insertmem()" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<jsp:include page="/WEB-INF/pages/admin/public/footer.jsp"></jsp:include>
<script type="text/javascript" src="admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="admin/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="admin/static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="admin/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-member-add").validate({
		rules:{
				name:{
				required:true,
				minlength:2,
				maxlength:16
			},
				password:{
				required:true,
				minlength:8,
				maxlength:16
			},
			gender:{
				required:true,
			},
			cellphone:{
				required:true,
				isMobile:true,
			},
			email:{
				required:true,
				email:true,
			},
			login_id:{
			required:true,
			login_id:true,
			},
			},
onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
				type: 'POST',
				url: "insertMember.action" ,
				data:{msg :"添加用户"},
				async: false,
				success: function(data){
					
					window.setTimeout(function(){
						layer.msg('添加成功!',{icon:1,time:1000});
					},0);
					
					window.setTimeout(function(){
						parent.location.reload();
					},1000);
					 
				},
                error: function(data){
                	alert('error');
                	layer.msg('添加失败!',{icon:1,time:1000});
				}
			});
			
		}
	});
});
</script> 
</body>
</html>